package com.itheima.web;

import com.itheima.pojo.Blog;
import com.itheima.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *  @RestController 后面都是异步请求的方法，所以这些异步方法都不能跳转页面，如果想跳转页面，另外再写 controller
 */

@RestController
public class BlogController {

    @Autowired
    private IUserService userService;

    @GetMapping("/findBlogs")
    public List<Blog> findBlogs(){
        return userService.findBlogs();
    }
}
